{% extends "opengoal/journal_base.html" %}

{% block content %}
    {% if message %}
        <div id="alert_id" class="alert-block alert-success">
            <button class="close" data-dismiss="alert_id">×</button>
            {{ message }}
        </div>
    {% endif %}
    {% for journal in journals %}
        {% comment %}
            HEADER
        {% endcomment %}
        <table style="width: 100%">
            <tr>
                <td style="width: 70%">
                    <h3>{{ journal.title }}</h3>
                </td>
                <td><a href="/journals/edit{{ journal.pk }}/"><img src="{{ STATIC_URL }}img/document_a4_edit.png"/> Edit</a>
                </td>
                <td><a href="/journals/delete/{{ journal.pk }}/"><img src="{{ STATIC_URL }}img/remove.png"/> Delete</a>
                </td>
            </tr>
        </table>
        <hr style="color:#666666;border:outset;">
        <table style="width: 100%">
            <tr>
                <td style="width: 70%"> Goal: {{ journal.goal }}</td>
                <td class="grey">Posted: {{ journal.created_date }}</td>
            </tr>
        </table>
        {% comment %}
            Base infos
        {% endcomment %}
        <div class="container" style="background-color: #b3b3b3;">
            <div class="span10" style="width: 90%;background-color: #ffffff;margin-bottom:10px;border: 1px ridge">
                {{ journal.content|safe }}
            </div>
            <div style="clear:both;float:right;">
                Tags:
                {% for tag in journal.tag_set.all %}
                    <a href="/journals/tags/{{ tag.tag.pk }}/">{{ tag.tag.name }}</a>
                    {% if not forloop.last %}
                        ,
                    {% endif %}
                {% endfor %}
            </div>
        </div>
    {% empty %}

    {% endfor %}

{% endblock content %}